unit TecnicoSearchFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, Buttons, DBGrids, StdCtrls, MainSearchFr;

type

  { TTecnicoSearchFrame }

  TTecnicoSearchFrame = class(TMainSearchFrame)
    idTecnicoEdit: TEdit;
    NomeTecnicoEdit: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure BitBtn1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses
  QueryConditions;

{ TTecnicoSearchFrame }

procedure TTecnicoSearchFrame.BitBtn1Click(Sender: TObject);
var
  condicoes: TQueryConditions;
begin
  condicoes := TQueryConditions.Create(CON_AND);
  Condicoes.AddJoinField('t.id_municipio', 'm.id_municipio');
  condicoes.Add('id_tecnico', idTecnicoEdit.Text);
  condicoes.AddText('nome_tecnico', NomeTecnicoEdit.Text);
  MainDataModule.Search(condicoes, 'tecnico t, municipio m');
end;

initialization
  {$I tecnicosearchfr.lrs}

end.
